package com.gulimall.coupon.controller;

import com.gulimall.common.utils.R;
import com.gulimall.coupon.entity.CouponHistoryEntity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author li bing
 * @date 2021/5/4 9:06
 */
@RestController
@RequestMapping("/coupon/coupon/")
@RefreshScope
public class CouponController {

    @Value("${couponName}")
    private String name;

    @GetMapping("member/list")
    public R memberCoupons(){
        CouponHistoryEntity couponHistoryEntity = new CouponHistoryEntity();
        couponHistoryEntity.setMemberNickName("ahhahahhahhahah");
        return R.ok().put("coupon",couponHistoryEntity);

    }

    @GetMapping("/getName")
    public R testConfig(){
        return R.ok(name);
    }

}
